<template>
  <div class="ranking-content">
    <music-list :playSongId="playSongId" @playMusic="playMusic" apiUrl="/v8/fcg-bin/fcg_v8_toplist_cp.fcg?g_tk=5381&uin=0&format=json&inCharset=utf-8&outCharset=utf-8&notice=0&platform=h5&needNewCode=1&tpl=3&page=detail&type=top&topid=27&_=1519963122923"></music-list>
  </div>
</template>
<script>
import MusicList from './MusicList.vue'
export default {
  components: {MusicList},
  data () {
    return {
      playSongId: ''
    }
  },
  mounted: function () {
    this.playSongId = this.$route.params.playSongId
  },
  methods: {
    playMusic: function (obj) {
      this.playSongId = obj.songId
      obj['context'] = this
      this.$router.app.$children[0].playMusic(obj) // 路由组件向上级通讯
    },
    setPlaySongId: function (playSongId) {
      this.playSongId = playSongId
    }
  }
}
</script>
